package base;

public class StringRev {

	public String getReverse(String given){
		if(given.length()==1){
			return given;
		}else{
			StringBuffer strbuffer = new StringBuffer();
			for(int i=given.length()-1;i>=0;i--){
				strbuffer.append(given.charAt(i)) ;
			}
			return strbuffer.toString();
		}
	}
	
	public static void main(String[] args) {
           StringRev rev = new StringRev();
           String big = new String("I am a human being");
           String[] bigarray = big.split(" ");
           StringBuffer reverse = new StringBuffer();
           for(int i=0;i<bigarray.length;i++){
        	   reverse.append(rev.getReverse(bigarray[i])+" ");
           }
           System.out.println("Reverse is "+reverse.toString());
	}

}
